<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        div input{
            color: red;
        }
    </style>
    <script>

    </script>
</head>
<body>
<!--<div id="d1">-->
    <!--<input name="myt" type="text" value="1" id="ip1" style="color:green">-->
    <!--<input name="myt" type="text" value="2">-->
    <!--<input name="myt" type="text" value="3">-->
    <!--<input name="myt" type="text" value="4" class="p1901">-->
    <!--<input name="myt" type="text" value="5" class="p1901">-->
    <!--<input name="myt" type="text" value="6" class="p1901" id="ip6">-->
<!--</div>-->
<form>
    <input type="submit" id="i1" value="不付钱离开" onclick="f1()">
    <input type="submit" id="i2" value="付钱离开">
    <input type="submit" id="i3" value="付钱不离开">

</form>
<script>

    var input = document.getElementById('i3');
    input.onclick = function (ev) {
        alert('客官 要加钟吗?')
    };

    document.getElementById('i2').onclick = function () {
        alert('客官请慢走');
    };

    var f1 = function () {
        alert('客官,请付费后再走');
    };
    // var ip0 = document.getElementsByTagName('input');
    // var ip1 = document.getElementById('ip1');

    var div = document.getElementById('d1');
    //var div = document.getElementById('d1');
    //子节点 不加括号
    // var input = div.childNodes;
    // for(i in input){
    //     console.log(i);
    //     console.log(input[i].nodeName);
    //     if(input[i].nodeName === 'INPUT'){
    //         input[i].value='p1901';
    //     }
    // }

    // div = ip1.parentNode;
    // ip1.nextSibling.nextSibling.value = '老王我是你邻居';
    // ip1.nextSibling.nextSibling.style.color = 'green';
    // var ip6 = document.getElementById('ip6');
    // var ip5 = ip6.previousSibling.previousSibling;
    // ip5.value = '前任你好';
    // ip5.style.color = 'green';


    // var h1 = document.createElement('h1');
    // h1.innerHTML ='金正恩抵俄 满面笑容走出火车站';
    // div.appendChild(h1);
    // div.remove();
</script>
</body>
</html>